libname study1 'C:\primary\Data\Dissertation.2001\Diss.1\';
libname study3 'C:\primary\Data\Dissertation.2001\Diss.3\';
libname study4 'C:\primary\Data\Dissertation.2001\Diss.4\';
libname study5 'C:\primary\Data\Dissertation.2001\Diss.5\';

data study5.allfourstudies; set study1.total study3.total study4.total study5.total;

data study5.allfourstudies; set study5.allfourstudies;

proc contents;run;
proc means;run;
proc means; class FIiatexcl; var FIiat;run;
proc means; class CEiatexcl; var CEiat;run;
proc means; class SHiatexcl; var SHiat;run;
proc means; class BWiatexcl; var BWiat;run;
proc means; class GSiatexcl; var GSiat;run;
proc means; class DRiatexcl; var DRiat;run;
proc means; class TFiatexcl; var TFiat;run;


*implicit multi-trait;
proc corr; var FIiat DRiat SHiat GSiat BWiat CEiat TFiat;run;

*implicit internal consistency;
proc corr; var FIiat1 DRiat1 SHiat1 GSiat1 BWiat1 CEiat1 TFiat1;
           with FIiat2 DRiat2 SHiat2 GSiat2 BWiat2 CEiat2 TFiat2;run;

*explicit multi-trait;
proc corr; var FIexp DRexp SHexp GSexp BWexp CEexp TFexp;run;

*explicit internal consistency;
proc corr; var FIexp1 DRexp1 SHexp1 GSexp1 BWexp1 CEexp1 TFexp1; 
           with FIexp2 DRexp2 SHexp2 GSexp2 BWexp2 CEexp2 TFexp2;run;

*implicit-explicit comparison;
proc corr; var FIiat DRiat SHiat GSiat BWiat CEiat TFiat;
           with FIexp DRexp SHexp GSexp BWexp CEexp TFexp;run;

data study5.allfourstudies; set study5.allfourstudies;
   if gender = 1 then sex = 1; else if gender = 0 then sex = 0; drop gender;

/*proc contents;run;
proc means; class sex;var sub;run;
proc means; class race; var sub;run;
proc means; class ethnic; var sub;run;
proc means; class ethin; var sub;run;*/

proc means n mean std t prt; var FIiat DRiat SHiat GSiat BWiat CEiat TFiat
                                 FIexp DRexp SHexp GSexp BWexp CEexp TFexp;run;

data study5.summarydata; set study5.allfourstudies;
     keep FIiat DRiat SHiat GSiat BWiat CEiat TFiat 
	      FIiat1 DRiat1 SHiat1 GSiat1 BWiat1 CEiat1 TFiat1
		  FIiat2 DRiat2 SHiat2 GSiat2 BWiat2 CEiat2 TFiat2
          FIexp DRexp SHexp GSexp BWexp CEexp TFexp
          FIexp1 DRexp1 SHexp1 GSexp1 BWexp1 CEexp1 TFexp1
		  FIexp2 DRexp2 SHexp2 GSexp2 BWexp2 CEexp2 TFexp2;run;